@if(count($topics) > 0)
    <ul class="list-group">
        @foreach($topics as $topic)
            <li class="list-group-item border-0 border-bottom
                            d-flex align-items-center
                            ">
                <div class="flex-shrink-0">
                    <a href="{{route('users.show',$topic->user->id)}}" >
                        <img class="img-thumbnail "
                             src="{{$topic->user->avatar}}"
                             alt="{{$topic->user->name}}"
                             width="50">
                    </a>
                </div>
                <div class="flex-grow-1 px-2 d-flex flex-column">
                    <a href="{{$topic->link()}}"
                       title="{{$topic->title}}"
                       class="text-decoration-none text-success">
                        {{$topic->title}}
                    </a>
                    <div>
                        <small class="text-secondary">
                            <i class="fa-regular fa-circle-user"></i>
                            <a class="text-decoration-none text-secondary"
                               title="{{$topic->user->name}}"
                               href="{{route('users.show',$topic->user->id)}}">{{$topic->user->name}}</a>
                            <span>    •   </span>
                            <i class="fa-regular fa-folder-closed "></i>
                            <a class="text-decoration-none text-secondary"
                               title="{{$topic->category->name}}"
                               href="{{route('categories.show',$topic->category->id)}}">
                                {{$topic->category->name}}
                            </a>
                            <span>    •   </span>
                            <i class="fa-regular fa-clock "></i>
                            <span class="text-decoration-none text-secondary"
                                  title="最新更新时间{{$topic->updated_at->diffForHumans()}}"
                                  href="">{{$topic->updated_at->diffForHumans()}}
                                            </span>
                        </small>
                    </div>
                </div>
                <div>
                    <a href="{{route('topics.show',$topic->id)}}">
                        <span class="badge rounded-pill text-bg-primary">{{$topic->reply_count}}</span>
                    </a>

                </div>
            </li>
        @endforeach
    </ul>
@else
   @include('shared._no_data')
@endif
